package com.moyz.adi.common.aop;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect  // 标记为切面
@Component  // 让 Spring 进行管理
public class MethodAspect {

    @Before("execution(* com.moyz.adi.common.service.*.*(..))")// 拦截 service 包下所有方法
    public void logMethodCall(JoinPoint joinPoint) {
        String methodName = joinPoint.getSignature().toShortString();
        System.out.println("🔹 调用方法: " + methodName);
    }

}
